<h1 id="hh"></h1>

<script>
    let obj = {
      name: "lilei",
      age: 30
    }
  
    let arr = [1, 2, 3, 4, 5]
  
    let proxyObj = new Proxy(obj, {
      get(target, key) {
        // console.log(target,key);
        // console.log('属性被访问了');
        return Reflect.get(target, key)
      },
      set(target, key, value) {
        console.log("value", value);
        console.log('属性被设置了');
        target[key] = value
        document.getElementById('hh').innerHTML = value
      },
    })
  </script>